import datetime
from exts import db


# ros数据
class UpdateRobotFirmwareRos(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    ros_name = db.Column(db.Text, nullable=False)
    ros_path = db.Column(db.Text, nullable=False)
    is_delete = db.Column(db.Boolean, default=False)
    create_time = db.Column(db.DateTime, default=datetime.datetime.now)

    def __str__(self):
        return self.ros_name


# 驱动数据
class UpdateRobotFirmwareDrive(db.Model):
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    drive_name = db.Column(db.Text, nullable=False)
    drive_path = db.Column(db.Text, nullable=False)
    is_delete = db.Column(db.Boolean, default=False)
    create_time = db.Column(db.DateTime, default=datetime.datetime.now)

    def __str__(self):
        return self.drive_name

# yaml数据展示
